package com.gxuwz.Market.business.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.Market.business.dao.ServiceStudioDAO;
import com.gxuwz.Market.business.entity.ServiceStudio;
import com.gxuwz.core.pagination.Result;

@Service("serviceStudioService")
public class ServiceStudioImpl implements IServiceStudioService {
	@Autowired
	private ServiceStudioDAO serviceStudioDAO;

	@Override
	public ServiceStudio findById(int id) {
		// TODO Auto-generated method stub
		return serviceStudioDAO.findById(id);
	}

	@Override
	public List<ServiceStudio> findAll() {
		// TODO Auto-generated method stub
		return serviceStudioDAO.findAll();
	}

	@Override
	public Result<ServiceStudio> find(ServiceStudio serviceStudio, int page, int size) {
		// TODO Auto-generated method stub
		return serviceStudioDAO.find(serviceStudio, page, size);
	}

	@Override
	public List<ServiceStudio> findByProperty(String property, String value) {
		// TODO Auto-generated method stub
		return serviceStudioDAO.findByProperty(property, value);
	}

	@Override
	public void add(ServiceStudio serviceStudio) {
		// TODO Auto-generated method stub
		serviceStudioDAO.save(serviceStudio);

	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub
		ServiceStudio serviceStudio = serviceStudioDAO.findById(id);
		serviceStudioDAO.remove(serviceStudio);

	}

	@Override
	public void update(ServiceStudio serviceStudio) {
		// TODO Auto-generated method stub
		serviceStudioDAO.update(serviceStudio);

	}

}
